package com.gxz.springboot.controller;

import com.gxz.springboot.bean.Car;
import com.gxz.springboot.bean.Monster;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Date;
@Controller
public class ResponseController {

    @GetMapping("/get/monster")
    @ResponseBody
    public Monster getMonster() {
       //开发中,monster 对象是从db获取
        Monster monster = new Monster();
        monster.setId(100);
        monster.setName("奔波霸");
        monster.setAge(2000);
        monster.setIsMarried(false);
        monster.setBirth(new Date());
        monster.setCar(new Car("奔驰",2000.2));
        return monster;
    }
}
